import { _decorator, Component, ProgressBar, director, Label, } from 'cc';

import { WsMgr } from '../TCP/WsMgr';
import { Utils } from '../Common/Utils';
import { Config } from '../Common/Config';
const { ccclass, property } = _decorator;



@ccclass('PlazaMgr')
export default class PlazaMgr extends Component {


    @property(Label)
    private socre: Label = null!;


    private wsSrc: WsMgr;


    onLoad() {
      
        this.wsSrc = WsMgr.getInstance();
        this.wsSrc.initPlazaMgr(this);
        let info=this.wsSrc.getPlayerInfo();
        this.socre.string= Utils.num1000(info.score);+'';
    }

   protected update(dt: number): void {
       
   }

  public goGame1(roomType:number){
    director.loadScene(Config.SCENE.GAME);
    this.wsSrc.joinTableType(1);
  }
  public goGame2(roomType:number){
    director.loadScene(Config.SCENE.GAME);
    this.wsSrc.joinTableType(2);
  }





}

